home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
ohlutil.zip
/
MAKEFILE
< prev
next >
Wrap
Text File
|
1990-06-23
|
8KB
|
233 lines
# Makefile for the GNU file utilities.
# Copyright (C) 1986, 1988, 1989, 1990 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 1, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
SHELL = /bin/sh
# If you use gcc, you should either run the fixincludes script that
# comes with it or else use gcc with the -traditional option. Otherwise
# ioctl calls will be compiled incorrectly on some systems.
CC = gcc
# Things you might add to CFLAGS:
# -DSTDC_HEADERS If you have ANSI C headers and libraries.
# -D_POSIX_SOURCE If you have POSIX.1 headers and libraries.
# -DSIGTYPE=int If your signal handlers return int, not void.
# -DUSG System V strings, headers, ndir.h.
# -DDIRENT If you have dirent.h.
# -DSYSNDIR Old Xenix systems (selects sys/ndir.h).
# -DINT_16_BITS On machines where sizeof long > sizeof int.
# -DHPUX_NFS_BUG On HP/UX (6.5 at least) where NFS files have
# reported blocksizes twice the correct size.
# -DVPRINTF_MISSING If you lack vprintf function (but have _doprnt).
# -DMKDIR_MISSING If you lack mkdir and rmdir system calls.
# -DFCHMOD_MISSING If you lack fchmod system call.
# -DRENAME_MISSING If you lack rename system call.
# -DFTRUNCATE_MISSING If you lack ftruncate system call.
# -DSTBLOCKS_MISSING If your `struct stat' lacks st_blocks and st_blksize.
# BSD
CFLAGS = -g -DSIGTYPE=int -DVPRINTF_MISSING
LIBS = $(LIBOBJS)
# SunOS 4.0
#CFLAGS = -g -DDIRENT
#LIBS = $(LIBOBJS)
# Typical System V
#CFLAGS = -g -DUSG -DMKDIR_MISSING -DFCHMOD_MISSING \
# -DRENAME_MISSING -DSTBLOCKS_MISSING \
# -DFTRUNCATE_MISSING -DMV_DIR=\"$(LIBDIR)/mv_dir\"
#LIBPROGS = mv_dir
#LIBINSTALL = install_lib
# Non-gcc users need -lPW to get alloca.
#LIBS = $(LIBOBJS) -lndir #-lPW
# SCO Xenix 386
# Recent versions have both sys/dir.h, linked with -lx,
# and dirent.h, linked with -ldir. In some versions, the -ldir
# library is buggy. But the -ldir routines are the only way to
# access network drives.
#CFLAGS = -g -DUSG -DMKDIR_MISSING -DFCHMOD_MISSING \
# -DRENAME_MISSING -DSTBLOCKS_MISSING \
# -Dftruncate=chsize -DSYSNDIR -DMV_DIR=\"$(LIBDIR)/mv_dir\"
#LIBPROGS = mv_dir
#LIBINSTALL = install_lib
# Non-gcc users need to get alloca from somewhere, like emacs or bash,
# and add alloca.o to LIBOBJS.
#LIBS = $(LIBOBJS) -lx
# HP/UX
#CFLAGS = -g -DUSG -DVPRINTF_MISSING
#LIBS = $(LIBOBJS)
LDFLAGS = -g
LIBOBJS = getopt.o getopt1.o
# Where to install the executables.
BINDIR = /usr/local/gnubin
# Where to put mv_dir on systems lacking the rename system call.
LIBDIR = /usr/local/lib
# Executable files in this directory.
PROGS = cat chmod cmp cp create dd du ginstall head ln dir vdir ls \
mkdir mkfifo mv rm rmdir tac tail
# Version of fileutils release.
VERSION = 1.3
# Files to include in the distribution archive.
DISTFILES = COPYING ChangeLog Makefile README \
backupfile.c cat.c chmod.c cmp.c cp-aux.c cp-hash.c cp.c cp.h \
create.c dd.c dirlib.c du.c eaccess.c error.c filemode.c \
getopt.c getopt1.c glob.c head.c ln.c ls.c mkdir.c mkfifo.c \
modechange.c modechange.h mv.c mv_dir.c rm.c rmdir.c tail.c \
tac.c regex.c getversion.c argmatch.c fileblocks.c install.c \
savedir.c backupfile.h getopt.h system.h regex.h
# The name of the distribution archive.
TARFILE = fileutils-$(VERSION).tar.Z
all: $(PROGS) $(LIBPROGS)
.PHONY: all
$(PROGS) $(LIBPROGS): $(LIBOBJS)
install: all $(LIBINSTALL)
ginstall $(PROGS) $(BINDIR)
cd $(BINDIR); ln -f dir d; ln -f vdir v; mv ginstall install
.PHONY: install
install_lib: $(LIBPROGS)
ginstall $(LIBPROGS) $(LIBDIR)
cd $(LIBDIR); chown root $(LIBPROGS); chmod 4755 $(LIBPROGS)
.PHONY: install_lib
# Linking rules.
cat: cat.o error.o
$(CC) $(LDFLAGS) -o $@ cat.o error.o $(LIBS)
chmod: chmod.o modechange.o filemode.o error.o savedir.o
$(CC) $(LDFLAGS) -o $@ chmod.o modechange.o filemode.o error.o \
savedir.o $(LIBS)
cmp: cmp.o error.o
$(CC) $(LDFLAGS) -o $@ cmp.o error.o $(LIBS)
cp: cp.o cp-hash.o cp-aux.o dirlib.o eaccess.o error.o backupfile.o \
getversion.o argmatch.o savedir.o
$(CC) $(LDFLAGS) -o $@ cp.o cp-hash.o cp-aux.o dirlib.o \
eaccess.o error.o backupfile.o getversion.o argmatch.o \
savedir.o $(LIBS)
create: create.o modechange.o dirlib.o error.o
$(CC) $(LDFLAGS) -o $@ create.o modechange.o dirlib.o error.o $(LIBS)
dd: dd.o error.o
$(CC) $(LDFLAGS) -o $@ dd.o error.o
dir: dir.o filemode.o glob.o error.o argmatch.o fileblocks.o
$(CC) $(LDFLAGS) -o $@ dir.o filemode.o glob.o error.o \
argmatch.o fileblocks.o $(LIBS)
du: du.o error.o fileblocks.o savedir.o
$(CC) $(LDFLAGS) -o $@ du.o error.o fileblocks.o savedir.o $(LIBS)
ginstall: install.o dirlib.o error.o
$(CC) $(LDFLAGS) -o $@ install.o dirlib.o error.o $(LIBS)
head: head.o error.o
$(CC) $(LDFLAGS) -o $@ head.o error.o $(LIBS)
ln: ln.o eaccess.o error.o backupfile.o getversion.o dirlib.o argmatch.o
$(CC) $(LDFLAGS) -o $@ ln.o eaccess.o error.o backupfile.o \
getversion.o dirlib.o argmatch.o $(LIBS)
ls: ls.o filemode.o glob.o error.o argmatch.o fileblocks.o
$(CC) $(LDFLAGS) -o $@ ls.o filemode.o glob.o error.o \
argmatch.o fileblocks.o $(LIBS)
mkdir: mkdir.o modechange.o dirlib.o error.o
$(CC) $(LDFLAGS) -o $@ mkdir.o modechange.o dirlib.o error.o $(LIBS)
mkfifo: mkfifo.o modechange.o dirlib.o error.o
$(CC) $(LDFLAGS) -o $@ mkfifo.o modechange.o dirlib.o error.o $(LIBS)
mv: mv.o eaccess.o error.o backupfile.o getversion.o dirlib.o argmatch.o
$(CC) $(LDFLAGS) -o $@ mv.o eaccess.o error.o backupfile.o \
getversion.o dirlib.o argmatch.o $(LIBS)
mv_dir: mv_dir.o error.o
$(CC) $(LDFLAGS) -o $@ mv_dir.o error.o
rm: rm.o dirlib.o eaccess.o error.o
$(CC) $(LDFLAGS) -o $@ rm.o dirlib.o eaccess.o error.o $(LIBS)
rmdir: rmdir.o dirlib.o error.o
$(CC) $(LDFLAGS) -o $@ rmdir.o dirlib.o error.o $(LIBS)
tac: tac.o error.o regex.o
$(CC) $(LDFLAGS) -o $@ tac.o error.o regex.o $(LIBS)
tail: tail.o error.o
$(CC) $(LDFLAGS) -o $@ tail.o error.o $(LIBS)
vdir: vdir.o filemode.o glob.o error.o argmatch.o fileblocks.o
$(CC) $(LDFLAGS) -o $@ vdir.o filemode.o glob.o error.o \
argmatch.o fileblocks.o $(LIBS)
# Compilation rules.
chmod.o create.o mkdir.o mkfifo.o modechange.o: modechange.h
cp.o mv.o ln.o backupfile.o getversion.o: backupfile.h
cp.o cp-hash.o cp-aux.o: cp.h
tac.o regex.o: regex.h
# C compilers that can't handle -c and -o together need the following:
#dir.o: ls.c
# $(CC) $(CFLAGS) -DMULTI_COL -c ls.c
# mv ls.o dir.o
#
#vdir.o: ls.c
# $(CC) $(CFLAGS) -DLONG_FORMAT -c ls.c
# mv ls.o vdir.o
dir.o: ls.c
$(CC) $(CFLAGS) -DMULTI_COL -o dir.o -c ls.c
vdir.o: ls.c
$(CC) $(CFLAGS) -DLONG_FORMAT -o vdir.o -c ls.c
# Use /bin/rm instead of ./rm in case ./rm is compiled for a different
# architecture.
clean:
/bin/rm -f $(PROGS) $(LIBPROGS) *.o tags TAGS a.out core
.PHONY: clean
dist: $(TARFILE)
.PHONY: dist
$(TARFILE): $(DISTFILES)
rm -rf fileutils-$(VERSION)
mkdir fileutils-$(VERSION)
ln $(DISTFILES) fileutils-$(VERSION)
tar cohf - fileutils-$(VERSION) | compress > $(TARFILE)
rm -rf fileutils-$(VERSION)